008 basic controls

好的,是时候进入令人兴奋的内容了。
OK it's time to get into the exciting stuff.

现在我们将学习如何在屏幕上放置几个控件并将一些信息发送到 PLCC。
Now we're going to learn how to drop a couple of controls on our screen and send some information into our PLCC.

所以现在我们要谈谈这件事。
So now we're going to get this thing talking.

让我们首先打开主屏幕,您会看到这里有这两个按钮。
Let's start by opening up our main screen and you see we've got these two buttons here.

我现在将把它们移到顶部,以消除它们的干扰。
I'm going to just move those up to the top for now to kind of get them out of the way.

我并不是说当这一切都尘埃落定之后,他们最终会走向何方。
I'm not saying that's where they're going to end up when it's all said and done.

但这就是我现在想要它们的地方。
But that's where I want them for right now.

让我们单击图形功能区,现在我们要按下按钮。
Let's click into our graphics ribbon and now we're going to bring down a push button.

因此,让我们在这里绘制它,我们将使用它作为系统启动按钮。
So let's draw that right here and we're going to use this as a system start button.

而且它已经是绿色的了,真是太方便了。
And how convenient that it's already green.

正确的。
Right.

因此,让我们双击它,我们立即可以看到这里有一种类型,我们可以使用瞬时保持或锁定动作。
So let's double click on this and right away we can see that there's a type here we can use momentary maintained or latched action.

我们总是使用瞬时。
We always use momentary.

至少我建议你这样做。
At least that's what I recommend you do.

所以这完全取决于你和国家正常开放的情况。
So that's completely up to you and the state normally open.

是的,我们将使用所有常开按钮,因为如果有任何反向操作(例如警报重置),我们将在 PC 内部执行此操作。
Yes we're going to use all of our buttons as normally open because if there's any reverse action like for alarm reset for instance we're going to do that inside of the PC.

我们不会在这里这样做。
We're not going to do that out here.

我们已经有了这个坦克表达式,让我们右键单击它并插入一个标签,然后进入我们的项目,如果我们愿意,我们可以单击 Boullion,这样我们就只能看到数字内容,然后我们的按钮开始。
We've got this tank expression let's right click on that and insert a tag and coming up here to our project we can just click on Boullion if we want so that we only see digital things and there's our push button start.

多么方便啊。
How convenient.

所以我们就点击“确定”。
So we'll hit OK on that.

现在我们已经有了标签,让我们继续点击配置,当按钮弹起时,我们就得到了文本一的标题。
So now that we've got our tag let's go ahead and hit config and we've got this caption of text one when the buttons up.

然后当我们按下它时,它会变成红色并显示文本 2。
And then when we push it down the thing turns red and says text 2.

嗯,我一点也不喜欢这样。
Well I don't like that at all.

所以每当我们把它推下来时,我都会让它变成更单调的绿色。
So whenever we push it down I'm going to make this go to maybe a more drab green color.

但我想说开始,我将复制它并将其粘贴到那里。
But I wanted to say start and I'm going to copy that and paste it over there.

那么就说开始吧。
So that's going to say start.

无论是向上还是向下。
Whether it's up or down.

但我会得到轻微的颜色变化,这样每当我按下这个按钮时我实际上就能看到差异。
But I am going to get a slight color change so that I can actually see a difference whenever I push this button.

因此,让我们点击“确定”并关闭,然后进入正在运行的 PEOC 程序,我将点击系统停止以确保我们现在没有运行。
So let's hit OK and close out of there and then let's go into our PEOC program that's running and I'm going to hit system stop just to make sure that we're not running now.

一旦我们启动应用程序并按下按钮,我们就应该能够返回这里并检查并发现我们正在运行。
And once we start our application up and hit the button then we should be able to come back in here and check and find that we're running.

这就是目标。
So that's the goal.

让我们看看它是否有效。
Let's find out if it works.

我们将继续并单击“运行”。
We're going to go ahead and click run.

当您运行这些应用程序之一时,它不会立即启动通信。
And when you run one of these applications it doesn't initiate communication immediately.

在实际工作之前有几秒钟的延迟。
There is a few second delay before it will actually work.

因此,如果您加载这个东西并快速按下启动按钮,那么当您转到应用程序时,您会发现它没有运行。
So if you load this thing up and jam jamón the start button real quick when you go over to your application you're going to look it is not running.

您可能认为自己有沟通问题,但实际上可能没有。
You might think you have a communication problem but you really probably don't.

您可能只是在它建立之前按下了按钮。
You probably just hit the button before it was established.

现在我们已经启动并运行,我将使用我的 alt 选项卡返回并确保我们的 C 程序正在运行,但您可以看到我们的“我们不处于运行模式”。
Now that we're up and running I'm going to use my alt tab to go back and make sure our C program is running but you can see our We're not in run mode.

让我们再次使用 alt 选项卡切换回那里。
Let's toggle back over there with alt tab again.

现在我要按下开始按钮,你会看到它如何变成深绿色。
And now I'm going to hit my start button and you see how it turns that darker green.

因此,这对操作员来说是一个很好的小反馈,让他知道他确实按下了按钮,你瞧,我们现在处于运行模式,所以我们知道该按钮正在工作,我们可以返回到我们的应用程序并退出。
So that's a nice little feedback to the operator to let him know that he actually did push the button and lo and behold we are in run mode now so we know that that button is working and we can go back into our application and exit out.

既然我们知道可以发送数字信号,那么让我们回到我们的环境中。
Let's come back into our environment now that we know we can send in a digital signal.

我们还致力于发送模拟信号,那么我们如何将数字发送到我们的 APRC 程序中。
Let's also work on sending in an analog signal so how do we send a number into our APRC program.

好吧,我将在这里讨论图形,文本框是一个选项。
Well I'm going to come up to graphics over here and a text box is an option.

因此,如果我想使用此列表中的某些内容,我可以绘制一个文本框。
So if I want to use something out of this list I could just draw a text box.

但当你看那件事时,它很简单。
But when you look at that thing it is kind of plain.

我并不是说我想使用它。
I'm not saying I want to use that.

有一些表格我可能会使用该文本框,但如果我来到这里并双击我的符号,还有另一种选择。
There are some forms which I probably will use that text box but there's also another option if I come down here and double click on my symbols.

好吧,如果我查看这个列表,你会在底部看到我有这段文字。
Well if I go down this list you see down here at the bottom I've got this text.

我知道。
I know.

那里有一些数字输入。
And that's got some numeric inputs on it right there.

所以我也可以使用其中之一来发送号码。
So I could use one of these to send a number in as well.

我只需双击该符号并将其放在这里,它就会显示还有另一个同名的符号。
I'm just going to double click on that and drop one right here and it says that there is another symbol with the same name.

我喜欢覆盖它,当我继续说“是”时,现在我有两个不同的东西可以用来将数字写入我的 PLCC。
What I like to override it and when I go ahead and say yes and now I've got two different things that I could use to write a number into my PLCC.

这个对我来说看起来更好一些。
This one looks a little bit nicer to me.

这个非常简单,但让我们继续尝试一下。
This one's pretty simple but let's go ahead and try both.

因此,我将双击它,对于标签,我可以右键单击并插入标签,或者我在这里有一个小菜单按钮,我将继续使用它。
So I'm going to double click on this and for a tag I could right click and insert tag or I've got this little menu button over here and I'll go ahead and take that.

我们可以用我们自己的方式写为 V-1 状态。
And we could write in our own way as V-1 status.

我们通常不想覆盖 H-2A 状态,我们使用按钮来控制它。
We don't normally want to override and H-2A status we use push buttons to control that.

但为了演示,我将继续将其写入 Espey 中。
But for the sake of just demonstration I'm going to go ahead and write into Espey one.

让我们继续并点击“确定”。
Let's go ahead and hit OK.

然后我就有了不同类型的价值观和类似的东西。
And then I've got different types of values and things like that.

我将设置最小值为零,最大值为二,因为我们实际上只希望这个值为零或一或二。
I'm going to set a minimum value of zero and a maximum value of two because we really only ever want this thing to be a zero or a one or two.

然后我们可以离开这里并进入我们创建的另一个数字条目。
And then we can close out of here and go into this other one this numeric entry that we created.

因此,对于主标签,它从该模拟值开始。
And so for main tag it starts off with this analog value.

我要删除它,它实际上没有给我一个选择标签的界面。
I'm gonna delete that and it's actually not giving me an interface to select a tag.

所以我只是将其作为下划线输入,让我们看看它是否允许这样做。
So I'm just going to type it in a underscore as the one and let's see if it allows that.

好吧,它会弹出标签,但它不会弹出一个界面来实际让我选择它,这有点奇怪。
OK so it pops up with the tag it just wouldn't bring up an interface to actually let me select it has kind of strange.

所以我想稍微扩展一下。
So then I want to expand this out a little bit.

我们想要多少位小数。
How many decimal places do we want.

好吧,我们将采用零位小数。
Well we're going to take ZERO decimal places on that.

我们要禁用它吗?
Do we want to disable this.

如果我们想禁用它,我们可以将其设置为 1,但我们没有这样做。
We could set this to one if we wanted to disable this but we don't.

那么我们的标签呢?
And what about our label.

现在它说的是价值,我将继续更改它以引用 H.O.
Right now it says value and I'm going to go ahead and change that to quote H.O.

a s v Dash 1,然后输入另一个引号。
a s v Dash 1 and then put another quote.

因为如果您在此处输入文本,则必须将其放在引号内,然后让我们继续并单击“确定”。
Because if you're typing text in here you have to put it within quotes and then let's go ahead and hit OK.

当我们运行这个东西时,我们将看到其中一个有效。
And when we run this thing up we're going to see that one of these works.

其中之一不起作用。
And one of them doesn't work.

然后我们将看看我们必须做什么才能使其发挥作用。
And then we're going to see what we have to do to make it work.

我将继续按下按钮,现在我们可以看到我们处于模式 2,这是有道理的,因为我们的系统正在运行,一切都必须正常运行才能运行。
I'm going to go ahead and hit the button and right now we can see that we're in mode 2 which makes sense because our systems running and everything has to be in order for it to be running.

因此,如果我进入此控件,我可以输入 1 按回车键,就像我更改了模式一样。
So if I come over here into this control I can type 1 hit enter and just like that I've changed my mode.

但是这里的这个控件呢?
But what about this control down here.

如果我尝试点击这里的内部,它真的不会让任何事情发生。
If I try clicking inside of here it really doesn't let anything happen.

然后,当我单击此处时,会弹出一个奇怪的小白框,我无法在其中输入内容,也无法单击它,我实际上什么也做不了。
And then when I click here I get this strange little white box that pops up and I can't type into it I can't click on it I can't really do anything.

有什么关系哟。
What's the deal yo.

我该如何让这件事发挥作用。
And how do I make this thing work.

我们离开这里吧。
Let's exit out of here.

好吧,当我点击这三个小点时,它应该会弹出一个弹出键盘。
Well when I click on these three little dots it should bring me up a pop up keyboard.

但目前还没有。
But at the moment it doesn't.

所以让我们解决这个问题。
So let's fix that.

让我们来到这里,拉出我们的项目功能区,然后我们将进入首选项,在首选项下,我们有一些我们想要在这里处理的不同的事情。
Let's come up here and pull up our project ribbon and then we're going to go into preferences and under Preferences we've got a couple of different things that we want to work on here.

因此,如果我们进入查看器,我们想要检查的事情之一就是在下面看到它说对文本对象使用弹出输入。
So if we go into viewer one of the things that we want to check is see down here it says use pop up input for text objects.

让我们继续点击它。
Let's go ahead and click on that.

这里还有另一件事,就是虚拟键盘。
And then there's another thing right here that says virtual keyboard.

我将点击它。
And I'm going to click on that.

它有一些不同的选项,但默认情况下我只想使用一个很好的键盘。
And it's got a few different options but for default I just want to use a keypad that's going to be good.

我继续击球。
And I go ahead and hit.

好的。
OK.

那么让我们尝试再次运行这个东西,看看会发生什么。
So let's try running this thing again and see what happens.

现在,当我单击“我的三点”时,请看一下。
Now when I click on My Three Dots take a look at that.

现在我实际上可以设置一些东西了。
Now I can actually set something.

因此,让我们继续将这两个按钮按下回车键。
So let's go ahead and put the two on that hit enter.

现在它起作用了。
And now it works.

当我点击这里同样的东西时,我可以看到我的最小值为零,最大值为二。
And when I click into here same thing I can see I've got a minimum of zero and a maximum of two.

所以让我们试着打到九。
So let's try and hit nine.

而且它说我超出了范围。
And it says I'm out of range.

所以让我们删除它并尝试点击 0 并宾果游戏。
So let's erase that and try hitting 0 and bingo.

现在我们处于关闭模式。
Now we're in off mode.

那些弹出式小键盘非常漂亮。
Those little pop up keypads are pretty nice.

我喜欢那些。
I like those.

这就是我们如何让这两个控件发挥作用。
And that's how we get both of these controls working.

因此,此时我们可以将数字信息发送到 PLCC,也可以将信息发送并记录到 PLCC。
So at this point we can now send digital information into our PLCC and we can also send and log information into our PLCC.

我要退出,我将向您展示另一件事,因为即使我在程序中不经常使用它们,我还是教学滑块的粉丝,因为我认为它们很棒,而且您我们可以在这里使用各种不同的滑块。
I'm going to exit out and I'm going to just show you one more thing because even though I don't use them very often in my programs I'm a fan of teaching sliders because I think they're great and you've got all kinds of different sliders that we can use in here.

让我们尝试一些基本的东西,我将双击这个最小的滑块并将其带到那里。
Let's just try something basic I'm just going to take this minimal slider double click that and bring that right there.

然后让我们进入这里和主要部分。
And then let's go in here and Main.

让我们看看我们想要多少位小数。
Let's see how many decimal places do we want.

我将在我们的主标签上保留零位小数。
I'm going to take ZERO decimal places on this for our main label.

我将把我的 hl 方式输入为 V-1。
I'm just going to type out my hl way as V-1.

再次在引号内,我的最大值将为 2。
Once again inside of the quotes my max is going to be 2.

我的最小值是零。
My minimum is zero.

对于标签,我双击了它,我将把我的 H.O.
And for tag I double clicked on that and I'm going to take my H.O.

单纯疱疹病毒 1.
HSV 1.

那会起作用的。
That'll work.

所以让我们继续并关闭它并重新开始运行。
So let's go ahead and close this and go back into a run.

现在,如果我把这个东西说到一,我们可以看到我的滑块弹出,或者我实际上可以使用滑块,我可以向上滑动该东西并将其设置为或向下为零。
And now if I said this thing up to one we can see my slider pops up or I can actually use the slider and I can slide that thing up and set it to to or down to zero.

所以看起来很棒。
So that looks great.

效果很好。
It works great.

我真的很喜欢它,所以我会使用其中的任何一个。
I really like it so will I use any of those.

可能不会。
Probably not.

但我确实认为它们非常酷,所以我就到此为止。
But I do think they are pretty cool so I'll leave it at that.

现在我们知道如何将东西灌输给我们的员工。
And now we know how to get stuff into our people.

瞧,这就是本次讲座的目的。
See that was the object of this lecture.

我们接下来再回来。
Let's come back in the next.

我们将更深入地了解显示器。
And we'll get a little bit more deep into displays.

那我就见到你了。
So I see you then.

干杯。
Cheers.